﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace InstallXSLT
{
    public partial class Form1 : Form
    {
        Installer installer;
        public Form1()
        {
            InitializeComponent();
            installer = new Installer();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBoxFolders.Text += "\n";
            textBoxFolders.Text += installer.installXslt();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            installer.findOfficeDir();

            if (installer.FoundFolders.Count > 0)
            {
                foreach (String verzeichnis in installer.FoundFolders)
                {
                    textBoxFolders.Text += verzeichnis + "\n";
                }
            }
            else
            {
                button1.Enabled = false;
                textBoxFolders.Text = "Kein Office Verzeichnis gefunden.\nBitte beachte die Hinweise in der Datei: Installationshinweise.txt";
            }
        }
    }
}
